3.2.9 \(\int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)^2} \, dx\) [109]

3.2.9.1 Optimal result
3.2.9.2 Mathematica [A] (verified)
3.2.9.3 Rubi [A] (verified)
3.2.9.4 Maple [C] (warning: unable to verify)
3.2.9.5 Fricas [F]
3.2.9.6 Sympy [F(-1)]
3.2.9.7 Maxima [F]
3.2.9.8 Giac [F]
3.2.9.9 Mupad [F(-1)]

3.2.9.1 Optimal result

Integrand size = 25, antiderivative size = 306 \[ \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)^2} \, dx=-\frac {b^2 c}{2 d^2 (i-c x)}+\frac {b^2 c \arctan (c x)}{2 d^2}-\frac {i b c (a+b \arctan (c x))}{d^2 (i-c x)}-\frac {i c (a+b \arctan (c x))^2}{2 d^2}-\frac {(a+b \arctan (c x))^2}{d^2 x}+\frac {c (a+b \arctan (c x))^2}{d^2 (i-c x)}-\frac {4 i c (a+b \arctan (c x))^2 \text {arctanh}\left (1-\frac {2}{1+i c x}\right )}{d^2}-\frac {2 i c (a+b \arctan (c x))^2 \log \left (\frac {2}{1+i c x}\right )}{d^2}+\frac {2 b c (a+b \arctan (c x)) \log \left (2-\frac {2}{1-i c x}\right )}{d^2}-\frac {i b^2 c \operatorname {PolyLog}\left (2,-1+\frac {2}{1-i c x}\right )}{d^2}+\frac {2 b c (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,-1+\frac {2}{1+i c x}\right )}{d^2}-\frac {i b^2 c \operatorname {PolyLog}\left (3,-1+\frac {2}{1+i c x}\right )}{d^2} \]

output
-1/2*b^2*c/d^2/(I-c*x)+1/2*b^2*c*arctan(c*x)/d^2-I*b*c*(a+b*arctan(c*x))/d 
^2/(I-c*x)-1/2*I*c*(a+b*arctan(c*x))^2/d^2-(a+b*arctan(c*x))^2/d^2/x+c*(a+ 
b*arctan(c*x))^2/d^2/(I-c*x)+4*I*c*(a+b*arctan(c*x))^2*arctanh(-1+2/(1+I*c 
*x))/d^2-2*I*c*(a+b*arctan(c*x))^2*ln(2/(1+I*c*x))/d^2+2*b*c*(a+b*arctan(c 
*x))*ln(2-2/(1-I*c*x))/d^2-I*b^2*c*polylog(2,-1+2/(1-I*c*x))/d^2+2*b*c*(a+ 
b*arctan(c*x))*polylog(2,-1+2/(1+I*c*x))/d^2-I*b^2*c*polylog(3,-1+2/(1+I*c 
*x))/d^2
 
3.2.9.2 Mathematica [A] (verified)

Time = 1.99 (sec) , antiderivative size = 406, normalized size of antiderivative = 1.33 \[ \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)^2} \, dx=-\frac {\frac {12 a^2}{x}+\frac {12 a^2 c}{-i+c x}+24 a^2 c \arctan (c x)+24 i a^2 c \log (c x)-12 i a^2 c \log \left (1+c^2 x^2\right )+b^2 c \left (\pi ^3+12 i \arctan (c x)^2+\frac {12 \arctan (c x)^2}{c x}-3 i \cos (2 \arctan (c x))+6 \arctan (c x) \cos (2 \arctan (c x))+6 i \arctan (c x)^2 \cos (2 \arctan (c x))+24 i \arctan (c x)^2 \log \left (1-e^{-2 i \arctan (c x)}\right )-24 \arctan (c x) \log \left (1-e^{2 i \arctan (c x)}\right )-24 \arctan (c x) \operatorname {PolyLog}\left (2,e^{-2 i \arctan (c x)}\right )+12 i \operatorname {PolyLog}\left (2,e^{2 i \arctan (c x)}\right )+12 i \operatorname {PolyLog}\left (3,e^{-2 i \arctan (c x)}\right )-3 \sin (2 \arctan (c x))-6 i \arctan (c x) \sin (2 \arctan (c x))+6 \arctan (c x)^2 \sin (2 \arctan (c x))\right )+\frac {6 a b \left (8 c x \arctan (c x)^2+4 c x \operatorname {PolyLog}\left (2,e^{2 i \arctan (c x)}\right )+c x \left (\cos (2 \arctan (c x))-4 \log (c x)+2 \log \left (1+c^2 x^2\right )-i \sin (2 \arctan (c x))\right )+2 \arctan (c x) \left (2+i c x \cos (2 \arctan (c x))+4 i c x \log \left (1-e^{2 i \arctan (c x)}\right )+c x \sin (2 \arctan (c x))\right )\right )}{x}}{12 d^2} \]

input
Integrate[(a + b*ArcTan[c*x])^2/(x^2*(d + I*c*d*x)^2),x]
 
output
-1/12*((12*a^2)/x + (12*a^2*c)/(-I + c*x) + 24*a^2*c*ArcTan[c*x] + (24*I)* 
a^2*c*Log[c*x] - (12*I)*a^2*c*Log[1 + c^2*x^2] + b^2*c*(Pi^3 + (12*I)*ArcT 
an[c*x]^2 + (12*ArcTan[c*x]^2)/(c*x) - (3*I)*Cos[2*ArcTan[c*x]] + 6*ArcTan 
[c*x]*Cos[2*ArcTan[c*x]] + (6*I)*ArcTan[c*x]^2*Cos[2*ArcTan[c*x]] + (24*I) 
*ArcTan[c*x]^2*Log[1 - E^((-2*I)*ArcTan[c*x])] - 24*ArcTan[c*x]*Log[1 - E^ 
((2*I)*ArcTan[c*x])] - 24*ArcTan[c*x]*PolyLog[2, E^((-2*I)*ArcTan[c*x])] + 
 (12*I)*PolyLog[2, E^((2*I)*ArcTan[c*x])] + (12*I)*PolyLog[3, E^((-2*I)*Ar 
cTan[c*x])] - 3*Sin[2*ArcTan[c*x]] - (6*I)*ArcTan[c*x]*Sin[2*ArcTan[c*x]] 
+ 6*ArcTan[c*x]^2*Sin[2*ArcTan[c*x]]) + (6*a*b*(8*c*x*ArcTan[c*x]^2 + 4*c* 
x*PolyLog[2, E^((2*I)*ArcTan[c*x])] + c*x*(Cos[2*ArcTan[c*x]] - 4*Log[c*x] 
 + 2*Log[1 + c^2*x^2] - I*Sin[2*ArcTan[c*x]]) + 2*ArcTan[c*x]*(2 + I*c*x*C 
os[2*ArcTan[c*x]] + (4*I)*c*x*Log[1 - E^((2*I)*ArcTan[c*x])] + c*x*Sin[2*A 
rcTan[c*x]])))/x)/d^2
 
3.2.9.3 Rubi [A] (verified)

Time = 0.91 (sec) , antiderivative size = 306, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.080, Rules used = {5411, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)^2} \, dx\)

\(\Big \downarrow \) 5411

\(\displaystyle \int \left (\frac {2 i c^2 (a+b \arctan (c x))^2}{d^2 (c x-i)}+\frac {c^2 (a+b \arctan (c x))^2}{d^2 (c x-i)^2}+\frac {(a+b \arctan (c x))^2}{d^2 x^2}-\frac {2 i c (a+b \arctan (c x))^2}{d^2 x}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {4 i c \text {arctanh}\left (1-\frac {2}{1+i c x}\right ) (a+b \arctan (c x))^2}{d^2}+\frac {2 b c \operatorname {PolyLog}\left (2,\frac {2}{i c x+1}-1\right ) (a+b \arctan (c x))}{d^2}-\frac {i b c (a+b \arctan (c x))}{d^2 (-c x+i)}-\frac {(a+b \arctan (c x))^2}{d^2 x}+\frac {c (a+b \arctan (c x))^2}{d^2 (-c x+i)}-\frac {i c (a+b \arctan (c x))^2}{2 d^2}+\frac {2 b c \log \left (2-\frac {2}{1-i c x}\right ) (a+b \arctan (c x))}{d^2}-\frac {2 i c \log \left (\frac {2}{1+i c x}\right ) (a+b \arctan (c x))^2}{d^2}+\frac {b^2 c \arctan (c x)}{2 d^2}-\frac {i b^2 c \operatorname {PolyLog}\left (2,\frac {2}{1-i c x}-1\right )}{d^2}-\frac {i b^2 c \operatorname {PolyLog}\left (3,\frac {2}{i c x+1}-1\right )}{d^2}-\frac {b^2 c}{2 d^2 (-c x+i)}\)

input
Int[(a + b*ArcTan[c*x])^2/(x^2*(d + I*c*d*x)^2),x]
 
output
-1/2*(b^2*c)/(d^2*(I - c*x)) + (b^2*c*ArcTan[c*x])/(2*d^2) - (I*b*c*(a + b 
*ArcTan[c*x]))/(d^2*(I - c*x)) - ((I/2)*c*(a + b*ArcTan[c*x])^2)/d^2 - (a 
+ b*ArcTan[c*x])^2/(d^2*x) + (c*(a + b*ArcTan[c*x])^2)/(d^2*(I - c*x)) - ( 
(4*I)*c*(a + b*ArcTan[c*x])^2*ArcTanh[1 - 2/(1 + I*c*x)])/d^2 - ((2*I)*c*( 
a + b*ArcTan[c*x])^2*Log[2/(1 + I*c*x)])/d^2 + (2*b*c*(a + b*ArcTan[c*x])* 
Log[2 - 2/(1 - I*c*x)])/d^2 - (I*b^2*c*PolyLog[2, -1 + 2/(1 - I*c*x)])/d^2 
 + (2*b*c*(a + b*ArcTan[c*x])*PolyLog[2, -1 + 2/(1 + I*c*x)])/d^2 - (I*b^2 
*c*PolyLog[3, -1 + 2/(1 + I*c*x)])/d^2
 

3.2.9.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 5411
Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_ 
.)*(x_))^(q_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*ArcTan[c*x])^p, (f* 
x)^m*(d + e*x)^q, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[p, 0] & 
& IntegerQ[q] && (GtQ[q, 0] || NeQ[a, 0] || IntegerQ[m])
 
3.2.9.4 Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 11.96 (sec) , antiderivative size = 8556, normalized size of antiderivative = 27.96

method result size
parts \(\text {Expression too large to display}\) \(8556\)
derivativedivides \(\text {Expression too large to display}\) \(8557\)
default \(\text {Expression too large to display}\) \(8557\)

input
int((a+b*arctan(c*x))^2/x^2/(d+I*c*d*x)^2,x,method=_RETURNVERBOSE)
 
output
result too large to display
 
3.2.9.5 Fricas [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)^2} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2}}{{\left (i \, c d x + d\right )}^{2} x^{2}} \,d x } \]

input
integrate((a+b*arctan(c*x))^2/x^2/(d+I*c*d*x)^2,x, algorithm="fricas")
 
output
-1/4*(2*(-I*b^2*c^2*x^2 - b^2*c*x)*log(2*c*x/(c*x - I))*log(-(c*x + I)/(c* 
x - I))^2 + 4*(-I*b^2*c^2*x^2 - b^2*c*x)*dilog(-2*c*x/(c*x - I) + 1)*log(- 
(c*x + I)/(c*x - I)) - (2*b^2*c*x - I*b^2)*log(-(c*x + I)/(c*x - I))^2 - 4 
*(c*d^2*x^2 - I*d^2*x)*integral(-(a^2*c*x + I*a^2 - (2*I*b^2*c^2*x^2 + (-I 
*a*b + b^2)*c*x + a*b)*log(-(c*x + I)/(c*x - I)))/(c^3*d^2*x^5 - I*c^2*d^2 
*x^4 + c*d^2*x^3 - I*d^2*x^2), x) + 4*(I*b^2*c^2*x^2 + b^2*c*x)*polylog(3, 
 -(c*x + I)/(c*x - I)))/(c*d^2*x^2 - I*d^2*x)
 
3.2.9.6 Sympy [F(-1)]

Timed out. \[ \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)^2} \, dx=\text {Timed out} \]

input
integrate((a+b*atan(c*x))**2/x**2/(d+I*c*d*x)**2,x)
 
output
Timed out
 
3.2.9.7 Maxima [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)^2} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2}}{{\left (i \, c d x + d\right )}^{2} x^{2}} \,d x } \]

input
integrate((a+b*arctan(c*x))^2/x^2/(d+I*c*d*x)^2,x, algorithm="maxima")
 
output
-a^2*(c/(c*d^2*x - I*d^2) - 2*I*c*log(c*x - I)/d^2 + 2*I*c*log(x)/d^2 + 1/ 
(d^2*x)) - 1/16*(8*(b^2*c^2*x^2 - I*b^2*c*x)*arctan(c*x)^3 - (-I*b^2*c^2*x 
^2 - b^2*c*x)*log(c^2*x^2 + 1)^3 + 4*(2*b^2*c*x - I*b^2)*arctan(c*x)^2 - ( 
2*b^2*c*x - I*b^2 - 2*(b^2*c^2*x^2 - I*b^2*c*x)*arctan(c*x))*log(c^2*x^2 + 
 1)^2 - 2*(128*b^2*c^4*integrate(1/16*x^4*arctan(c*x)^2/(c^4*d^2*x^6 + 2*c 
^2*d^2*x^4 + d^2*x^2), x) + 32*b^2*c^4*integrate(1/16*x^4*log(c^2*x^2 + 1) 
^2/(c^4*d^2*x^6 + 2*c^2*d^2*x^4 + d^2*x^2), x) - 64*b^2*c^4*integrate(1/16 
*x^4*log(c^2*x^2 + 1)/(c^4*d^2*x^6 + 2*c^2*d^2*x^4 + d^2*x^2), x) + (c*(x/ 
(c^4*d^2*x^2 + c^2*d^2) + arctan(c*x)/(c^3*d^2)) - 2*arctan(c*x)/(c^4*d^2* 
x^2 + c^2*d^2))*b^2*c^3 + 32*b^2*c^2*integrate(1/16*x^2*arctan(c*x)^2/(c^4 
*d^2*x^6 + 2*c^2*d^2*x^4 + d^2*x^2), x) + 24*b^2*c^2*integrate(1/16*x^2*lo 
g(c^2*x^2 + 1)^2/(c^4*d^2*x^6 + 2*c^2*d^2*x^4 + d^2*x^2), x) - 256*a*b*c^2 
*integrate(1/16*x^2*arctan(c*x)/(c^4*d^2*x^6 + 2*c^2*d^2*x^4 + d^2*x^2), x 
) - 64*b^2*c^2*integrate(1/16*x^2*log(c^2*x^2 + 1)/(c^4*d^2*x^6 + 2*c^2*d^ 
2*x^4 + d^2*x^2), x) - 64*b^2*c*integrate(1/16*x*arctan(c*x)*log(c^2*x^2 + 
 1)/(c^4*d^2*x^6 + 2*c^2*d^2*x^4 + d^2*x^2), x) + 64*b^2*c*integrate(1/16* 
x*arctan(c*x)/(c^4*d^2*x^6 + 2*c^2*d^2*x^4 + d^2*x^2), x) + 96*b^2*integra 
te(1/16*arctan(c*x)^2/(c^4*d^2*x^6 + 2*c^2*d^2*x^4 + d^2*x^2), x) + 8*b^2* 
integrate(1/16*log(c^2*x^2 + 1)^2/(c^4*d^2*x^6 + 2*c^2*d^2*x^4 + d^2*x^2), 
 x) + 256*a*b*integrate(1/16*arctan(c*x)/(c^4*d^2*x^6 + 2*c^2*d^2*x^4 +...
 
3.2.9.8 Giac [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)^2} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2}}{{\left (i \, c d x + d\right )}^{2} x^{2}} \,d x } \]

input
integrate((a+b*arctan(c*x))^2/x^2/(d+I*c*d*x)^2,x, algorithm="giac")
 
output
sage0*x
 
3.2.9.9 Mupad [F(-1)]

Timed out. \[ \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)^2} \, dx=\int \frac {{\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )}^2}{x^2\,{\left (d+c\,d\,x\,1{}\mathrm {i}\right )}^2} \,d x \]

input
int((a + b*atan(c*x))^2/(x^2*(d + c*d*x*1i)^2),x)
 
output
int((a + b*atan(c*x))^2/(x^2*(d + c*d*x*1i)^2), x)